API Documentation
Node.h
1 // Node.h
3 //
5 
6 namespace nkExport
7 {
12  {
22  } ;
23 
28  {
33  } ;
34 }
35 
36 namespace nkExport
37 {
41  class DLL_EXPORT_EXPORT Node final
42  {
43  public :
44 
48  Node () ;
52  ~Node () ;
53 
54  // Getters
66  bool isValueTypeNumber () const ;
72  std::string_view getValueAsString () const ;
78  int getValueAsInt () const ;
84  unsigned int getValueAsUint () const ;
90  long long getValueAsLong () const ;
96  unsigned long long getValueAsUlong () const ;
102  float getValueAsFloat () const ;
108  double getValueAsDouble () const ;
114  bool getValueAsBool () const ;
118  unsigned int getMemberCount () const ;
126  std::string_view getMemberKey (unsigned int index) ;
133  Node* getMemberValue (unsigned int index) ;
140  Node* getMemberValue (const std::string_view& key) ;
144  unsigned int getArraySize () const ;
149  Node* getArrayElement (unsigned int index) ;
153  void* getUserData () const ;
154 
155  // Setters
161  void setAsString (const std::string_view& value) ;
167  void setAsInt (int value) ;
173  void setAsUint (unsigned int value) ;
179  void setAsLong (long long value) ;
185  void setAsUlong (unsigned long long value) ;
191  void setAsFloat (float value) ;
197  void setAsDouble (double value) ;
203  void setAsBool (bool value) ;
212  Node* addMember (const std::string_view& key) ;
220  void deleteMember (const std::string_view& key) ;
235  void setUserData (void* value) ;
236  } ;
237 }
nkExport::Node::getValueAsUint
unsigned int getValueAsUint() const
nkExport::Node::getMemberKey
std::string_view getMemberKey(unsigned int index)
nkExport::Node::getValueAsString
std::string_view getValueAsString() const
nkExport::Node::setAsFloat
void setAsFloat(float value)
nkExport::Node::setAsBool
void setAsBool(bool value)
nkExport::Node::getValueAsFloat
float getValueAsFloat() const
nkExport::EMPTY_NATURE
@ EMPTY_NATURE
Represents an empty node.
Definition: Node.h:29
nkExport::Node::setAsUint
void setAsUint(unsigned int value)
nkExport::Node::setAsString
void setAsString(const std::string_view &value)
nkExport::Node::addMember
Node * addMember(const std::string_view &key)
nkExport::FLOAT_TYPE
@ FLOAT_TYPE
A node holding a float.
Definition: Node.h:20
nkExport::DOUBLE_TYPE
@ DOUBLE_TYPE
A node holding a double.
Definition: Node.h:21
nkExport::Node::deleteMember
void deleteMember(const std::string_view &key)
nkExport::Node::~Node
~Node()
nkExport
Encompasses all API of component NilkinsExport.
Definition: ExportError.h:7
nkExport::Node::addElement
Node * addElement()
nkExport::Node::getMemberValue
Node * getMemberValue(unsigned int index)
nkExport::Node::isValueTypeNumber
bool isValueTypeNumber() const
nkExport::Node::getMemberCount
unsigned int getMemberCount() const
nkExport::Node::getValueAsBool
bool getValueAsBool() const
nkExport::Node::getValueAsDouble
double getValueAsDouble() const
nkExport::Node::getUserData
void * getUserData() const
nkExport::STRING_TYPE
@ STRING_TYPE
A node holding a string.
Definition: Node.h:15
nkExport::Node::setAsLong
void setAsLong(long long value)
nkExport::NODE_VALUE_TYPE
NODE_VALUE_TYPE
Describes the kind of value a node holds.
Definition: Node.h:12
nkExport::UINT_TYPE
@ UINT_TYPE
A node holding an unsigned integer.
Definition: Node.h:17
nkExport::Node
A node in the tree structure representing the data to export / import.
Definition: Node.h:42
nkExport::Node::getValueAsLong
long long getValueAsLong() const
nkExport::Node::getNodeNature
NODE_NATURE getNodeNature() const
nkExport::OBJECT_NATURE
@ OBJECT_NATURE
Represents a node holding references to other nodes, via the named member accessors.
Definition: Node.h:31
nkExport::VALUE_NATURE
@ VALUE_NATURE
Represents a leaf node, holding a final value being either a bool, string, int, uint,...
Definition: Node.h:30
nkExport::LONG_TYPE
@ LONG_TYPE
A node holding a long (8 bytes).
Definition: Node.h:18
nkExport::Node::getMemberValue
Node * getMemberValue(const std::string_view &key)
nkExport::BOOL_TYPE
@ BOOL_TYPE
A node holding a boolean.
Definition: Node.h:14
nkExport::INT_TYPE
@ INT_TYPE
A node holding an integer.
Definition: Node.h:16
nkExport::Node::getValueAsUlong
unsigned long long getValueAsUlong() const
nkExport::Node::setAsDouble
void setAsDouble(double value)
nkExport::NODE_NATURE
NODE_NATURE
Describes the nature of a node.
Definition: Node.h:28
nkExport::Node::setAsInt
void setAsInt(int value)
nkExport::Node::getNodeValueType
NODE_VALUE_TYPE getNodeValueType() const
nkExport::NOT_VALUE_TYPE
@ NOT_VALUE_TYPE
A node which is an object or an array will have no value attached. In such case, this value is return...
Definition: Node.h:13
nkExport::ULONG_TYPE
@ ULONG_TYPE
A node holding an unsigned long (8 bytes).
Definition: Node.h:19
nkExport::Node::getArrayElement
Node * getArrayElement(unsigned int index)
nkExport::Node::getValueAsInt
int getValueAsInt() const
nkExport::Node::Node
Node()
nkExport::ARRAY_NATURE
@ ARRAY_NATURE
Represents a node holding references to other nodes, via the indexed array accessors.
Definition: Node.h:32
nkExport::Node::setAsUlong
void setAsUlong(unsigned long long value)
nkExport::Node::setUserData
void setUserData(void *value)
nkExport::Node::getArraySize
unsigned int getArraySize() const